import { create } from 'zustand'

interface ValidateStore {
  // bears: number
  // increase: (by: number) => void
  errors: Record<string, string[]>
  setErrors: (errors: Record<string, string[]>) => void
  resetErrors: () => void
}

export const useValidateStore = create<ValidateStore>()((set) => ({
  // bears: 0,
  // increase: (by) => set((state) => ({ bears: state.bears + by })),
  errors: {},
  setErrors: (errors) =>
    set((state) => {
      return { errors: { ...state.errors, ...errors } }
    }),
  resetErrors: () => set({ errors: {} })
}))
